<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {border: 1px solid;}
    </style>
</head>
<body>
    
    <ul id="app">

    </ul>
    <script>
        var fruits = ['香蕉', '苹果', '雪梨', '火龙果'];

        var app = document.getElementById('app');

        var str = '';
        for (var i=0;i<fruits.length;i++) {
            var item = fruits[i];
            str += `<li style="color: red;">${item}</li>`
        }
        console.log(str);
        app.innerHTML = str;
    </script>
</body>
</html>